import './index.less';
/* eslint-disable */
function removal(a) {
    let newArr = a.reduce(
        (unique, item) => (unique.includes(item) ? unique : [...unique, item]),
        []
    );
    return newArr;
}

console.log(removal(['4', '5', '6', '5', '8']));

/**
 * 1.sw必须运行在服务器上
 *      -->node.js
 *      -->npm i serve -g
 *          serve -s build 启动服务，将build目录下所有资源作为静态资源暴露出去
 * 注册serviceWorker
 * 注册兼容性问题
 */
if ('serviceWorker' in navigator) {
    window.addEventListener('load', () => {
        navigator.serviceWorker
            .register('/service-worker.js')
            .then(() => {
                console.log('serviceWorker成功');
            })
            .catch(() => {
                console.log('serviceWorker失败');
            });
    });
}
